package com.nt.train.service.condition;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;
/**
 * 1.实现 Condition 接口来定义判断条件
 * Linux系统的判断条件
 * @author hlf
 * @version 1.0
 * @date 2022/8/4 10:39
 */
public class LinuxCondition implements Condition {

    @Override
    public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
        return context.getEnvironment().getProperty("os.name").contains("Linux");
    }
}